package com.sx.springbootshiro.common.exception;

import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.apache.shiro.authz.AuthorizationException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class TotalExceptionHandler {
    private Logger logger = LogManager.getLogger(TotalExceptionHandler.class);

    @ExceptionHandler
    @ResponseBody
    public String authorizationException(AuthorizationException e){
        logger.debug("没有通过权限验证 " + e);
        return "没有通过权限验证";
    }

}
